
{extend name='public/alert' /}

{block name="content"}

<div class="layui-fluid">
    <div class="layui-card">

        <div class="layui-card-body" style="padding: 15px;">

            <form class="layui-form " lay-filter="form">

                <div class="layui-form-item">
                    <label class="layui-form-label">名称：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="name" lay-verify="required" placeholder="名称必填" class="layui-input">
                    </div>
                    <div class="layui-form-mid layui-word-aux">
                        在4到25个字符之间。
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">类型：</label>
                    <div class="layui-input-inline">
                        <input type="radio" name="type"  value="0" lay-verify="required"  title="临时" checked>
                        <input type="radio" name="type"  value="1" lay-verify="required" title="永久">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">过期时间：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="expire_seconds" value="2592000" placeholder="过期时间" class="layui-input">
                    </div>
                    <div class="layui-form-mid layui-word-aux">
                        临时二维码过期时间, 最大为30天（2592000秒）
                    </div>
                </div>


                {:widget('common/forms/submit',array('add','立即提交',2))}

            </form>
        </div>

    </div>
</div>


<script>
    layui.use(['element', 'form', 'jquery','lucky'], function () {
        let element = layui.element;
        let table = layui.table;
        let form = layui.form;
        let $ = layui.jquery;
        let lucky=layui.lucky;

        form.render();

        form.on('submit(add)', function (data) {
            lucky.FormSubmit("{:url('qrcodeAdd')}",data.field,"table_id",1);
            return false;
        });
    })
</script>

{/block}

